package com.rc.saas.tenant.common.enums;


/**
 * Create by Yang on 2021/9/10
 * 充电终止原因定义
 */
public enum JnStopReasonEnum {

    STOP_REASON_ENUM_0(0, "自动充满"),
    STOP_REASON_ENUM_1(1, "达到设定时间"),
    STOP_REASON_ENUM_2(2, "达到设定电量"),
    STOP_REASON_ENUM_3(3, "达到设定金额"),
    STOP_REASON_ENUM_4(4, "触摸屏通讯故障"),
    STOP_REASON_ENUM_5(5, "电能表通讯故障"),
    STOP_REASON_ENUM_6(6, "连接确认异常"),
    STOP_REASON_ENUM_7(7, "输入过压"),
    STOP_REASON_ENUM_8(8, "输入欠压"),
    STOP_REASON_ENUM_9(9, "输出过压"),
    STOP_REASON_ENUM_10(10, "输出欠压"),
    STOP_REASON_ENUM_11(11, "PWM电压异常"),
    STOP_REASON_ENUM_12(12, "急停拍下"),
    STOP_REASON_ENUM_13(13, "输出过流"),
    STOP_REASON_ENUM_14(14, "防雷器故障"),
    STOP_REASON_ENUM_15(15, "充电监控通讯故障"),
    STOP_REASON_ENUM_16(16, "直流母线过压"),
    STOP_REASON_ENUM_17(17, "直流母线绝缘下降"),
    STOP_REASON_ENUM_18(18, "单体电池过压"),
    STOP_REASON_ENUM_19(19, "单体电池过温"),
    STOP_REASON_ENUM_20(20, "风扇故障"),
    STOP_REASON_ENUM_21(21, "系统过温"),
    STOP_REASON_ENUM_22(22, "BMS通讯故障"),
    STOP_REASON_ENUM_23(23, "接地故障"),
    STOP_REASON_ENUM_24(24, "电池反接"),
    STOP_REASON_ENUM_25(25, "电池电压和报文上送不一致"),
    STOP_REASON_ENUM_26(26, "车允许充电超时(10min)"),
    STOP_REASON_ENUM_27(27, "输出电压大于最高允许充电电压"),
    STOP_REASON_ENUM_28(28, "电池状态不正常结束充电"),
    STOP_REASON_ENUM_29(29, "开始预充过程收到了BMS未准备就绪报文BRO (00)"),
    STOP_REASON_ENUM_30(30, "电子锁未锁住"),
    STOP_REASON_ENUM_31(31, "主接触器故障"),
    STOP_REASON_ENUM_32(32, "门禁告警停止"),
    STOP_REASON_ENUM_33(33, "充电模块故障"),
    STOP_REASON_ENUM_34(34, "充电电流过小"),
    STOP_REASON_ENUM_35(35, "余额不足"),
    STOP_REASON_ENUM_36(36, "人为主动停止"),
    STOP_REASON_ENUM_37(37, "电表电能异常值"),
    STOP_REASON_ENUM_38(38, "系统断电"),
    STOP_REASON_ENUM_39(39, "网络断线"),
    STOP_REASON_ENUM_40(40, "充电枪过温"),
    STOP_REASON_ENUM_41(41, "单体蓄电池电压过低"),
    STOP_REASON_ENUM_42(42, "整车蓄电池SOC过高"),
    STOP_REASON_ENUM_43(43, "整车蓄电池SOC过低"),
    STOP_REASON_ENUM_44(44, "动力蓄电池充电过流"),
    STOP_REASON_ENUM_45(45, "动力蓄电池绝缘异常"),
    STOP_REASON_ENUM_46(46, "动力蓄电池组输出连接器异常"),
    STOP_REASON_ENUM_47(47, "BMS达到设定SOC"),
    STOP_REASON_ENUM_48(48, "BMS达到设定总电压"),
    STOP_REASON_ENUM_49(49, "BMS达到单体电压设定值"),
    STOP_REASON_ENUM_50(50, "BMS绝缘异常"),
    STOP_REASON_ENUM_51(51, "BMS连接器过温"),
    STOP_REASON_ENUM_52(52, "BMS元件过温"),
    STOP_REASON_ENUM_53(53, "BMS连接器故障"),
    STOP_REASON_ENUM_54(54, "BMS电池组过温"),
    STOP_REASON_ENUM_55(55, "BMS高压继电器故障"),
    STOP_REASON_ENUM_56(56, "BMS监测点2电压异常"),
    STOP_REASON_ENUM_57(57, "BMS其它故障"),
    STOP_REASON_ENUM_58(58, "BMS报电流异常的停止充电"),
    STOP_REASON_ENUM_59(59, "BMS报电压异常的停止充电"),
    STOP_REASON_ENUM_60(60, "车辆最高允许充电总电压不匹配(小于模块最小输出电压)"),
    STOP_REASON_ENUM_61(61, "充电需求大于蓄电池参数(BCP最大允许充电电压、电流参数)"),
    STOP_REASON_ENUM_62(62, "刷卡停止"),
    STOP_REASON_ENUM_63(63, "屏幕停止"),
    STOP_REASON_ENUM_64(64, "其他方式停止"),
    STOP_REASON_ENUM_65(65, "BRM报文超时"),
    STOP_REASON_ENUM_66(66, "BCP报文超时"),
    STOP_REASON_ENUM_67(67, "BRO报文超时"),
    STOP_REASON_ENUM_68(68, "BCS 报文超时"),
    STOP_REASON_ENUM_69(69, "BCL报文超时"),
    STOP_REASON_ENUM_70(70, "BST报文超时"),
    STOP_REASON_ENUM_71(71, "BSD报文超时"),
    STOP_REASON_ENUM_72(72, "其他报文超时");

    private int code;

    private String msg;


    /**
     * 解析code
     *
     * @param code
     * @return
     */
    public static String getMsgJnStopReason(Integer code) {
        Class<JnStopReasonEnum> shWarnCodeEnumClass = JnStopReasonEnum.class;
        for (JnStopReasonEnum enumConstant : shWarnCodeEnumClass.getEnumConstants()) {
            if (enumConstant.getCode() == code) {
                return enumConstant.getMsg();
            }
        }
        return "无告警码或无效告警码";
    }

    JnStopReasonEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}


